<%--
  Created by IntelliJ IDEA.
  User: meng
  Date: 2020/5/7
  Time: 17:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%String path=request.getContextPath();%>


    <div id="ccc">
        <h2 class="title">个人信息</h2>
        <p>带有星号的选项必填</p>
    </div>

        <form id="myform1" method="post" action="${pageContext.servletContext.contextPath}/web/person/personInfoUpdate">
            <fieldset>
                <input type="hidden" name="personId1" value="${sessionScope.person.id}">
                <span class="span1">姓名<span class="xin">*</span>
                    <input lay-verify="required" type="text" name="name1" id="name1" placeholder="${sessionScope.person.name}" required minlength="2">
                </span>
                <span class="span1">性别<span class="xin">*</span>
                    <input type="radio" name="personSex1" id="personSex1" value="男" required checked><span class="sex1" for="personSex1">男</span>
                    <input type="radio" name="personSex1" id="personSex2" value="女" required><span class="sex1" for="personSex2">女</span>
                </span>
                <span class="span1">出生年月日<span class="xin">*</span>&nbsp;&nbsp;&nbsp;
                    <fmt:formatDate value='${sessionScope.person.birth}'/>
                    <input type="date" name="personAge1" id="personAge1" value="<fmt:formatDate value='${sessionScope.person.birth}'/>" placeholder="请选择日期" required>
                </span>
                <span class="span1">手机号<span class="xin">*</span>
                    <input type="text" name="personPhone1" id="personPhone1" placeholder="${sessionScope.person.phone}" required pattern="^[1][34578]\d{9}$">
                </span>
                <input type="submit" id="sub1"></span>
            </fieldset>
        </form>



<script type="text/javascript" src="<%=path%>/static/js/jquery-3.4.1.min.js"></script>

<script type="text/javascript">
    $(function(){
        <c:if test="${'男' eq sessionScope.person.sex}">
        $("#personSex1").attr("checked",true);
        </c:if>
        <c:if test="${'女' eq sessionScope.person.sex}">
        $("#personSex2").attr("checked",true);
        </c:if>
    });
</script>

<style type="text/css">
    #ccc{margin: auto;width: 200px;}
    p{color: #b1dfbb;}
    #myform1{height: 550px;}
    #myform1 fieldset {margin:30px auto;width:600px;height:550px;padding:20px;color:blue; /*text-align:center;*/}
    #myform1 .span1{display: inline-block;width: 600px;text-align: left;text-align-last: left;margin-right: 20px;margin-top: 40px;}
    .xin{margin-left: 3px;/*padding-top: 15px;*/;color: red;}
    #name1{padding: 5px 0px;width: 300px;margin-top: -25px;margin-left: 150px;}
    #personSex1{margin-left: 150px;margin-top: 5px;}
    #personSex2{margin-left: 150px;margin-top: 5px;}
    .sex1{margin-left: 5px;}
    #personAge1{padding: 5px 0px;width: 300px;margin-top: -25px;margin-left: 30px;}
    #personPhone1{padding: 5px 0px;width: 300px;margin-top: -25px;margin-left: 150px;}
    #sub1{margin-top: 65px;margin-left: 300px;}
</style>